public class Demo18 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();

        synchronized(object) {
            System.out.println("调用wait之前");
            // 把wait放在synchronized里面来调用,确实是先拿到了锁
            object.wait();
            // 然后阻塞等待,等待到其他线程调用nofity唤醒
            System.out.println("调用wait之后");
        }
    }
}
